﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LibraryDetails.ascx.cs" Inherits="LibraryDetails" %>
<h3>Library Details</h3>

<table>
    <tr>
        <td>
            <h4>Library Information</h4></td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            Name:</td>
        <td>
            <asp:TextBox ID="txtLibraryName" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="vldNameReq" runat="server" 
                ErrorMessage="Library name required" ControlToValidate="txtLibraryName" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            Motto:</td>
        <td>
            <asp:TextBox ID="txtMotto" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Head Librarian:</td>
        <td>
            <asp:TextBox ID="txtLibrarian" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="vldNameReq1" runat="server" 
                ErrorMessage="Head librarian required" ControlToValidate="txtLibrarian" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            Phone Number:</td>
        <td>
            <asp:TextBox ID="txtPhoneNumber" runat="server"></asp:TextBox>
            &nbsp;(ex. 5554443333)
            <asp:RequiredFieldValidator ID="vldPhoneReq" runat="server" 
                ErrorMessage="Phone number required" ControlToValidate="txtPhoneNumber" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        &nbsp;<asp:RegularExpressionValidator ID="vldPhoneFormat" runat="server" 
                ControlToValidate="txtPhoneNumber" 
                ErrorMessage="Phone number should be entered without any punctuation" 
                ValidationExpression="\d{10}" ValidationGroup="grpLibraryDetails"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
            Address:</td>
        <td>
            <asp:TextBox ID="txtAddress" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="vldAddressReq" runat="server" 
                ErrorMessage="Address required" ControlToValidate="txtAddress" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            City:</td>
        <td>
            <asp:TextBox ID="txtCity" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="vldCityReq" runat="server" 
                ErrorMessage="City required" ControlToValidate="txtCity" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            State:</td>
        <td>
            <asp:DropDownList ID="ddlState" runat="server">
                <asp:ListItem>OR</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>
            Contact Email:</td>
        <td>
            <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="vldEmailReq" runat="server" 
                ErrorMessage="Library contact email required" ControlToValidate="txtEmail" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            Hours:</td>
        <td>
            <asp:TextBox ID="txtHours" runat="server" Rows="4"></asp:TextBox>
            <asp:RequiredFieldValidator ID="vldHoursReq" runat="server" 
                ErrorMessage="Hours required" ControlToValidate="txtHours" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            Theme:</td>
        <td>
            <asp:DropDownList ID="ddlTheme" runat="server">
                <asp:ListItem>Blue</asp:ListItem>
                <asp:ListItem>Green</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>
            <h4>Fine Information</h4></td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            Fine per day:</td>
        <td>$<asp:TextBox ID="txtFinePerDay" runat="server"></asp:TextBox><asp:RequiredFieldValidator 
                ID="vldFinePerDayReq" runat="server" 
                ErrorMessage="Fine per day required" ControlToValidate="txtFinePerDay" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>&nbsp;<asp:RegularExpressionValidator 
                ID="vldFinePerDayFormat" runat="server" 
                ControlToValidate="txtFinePerDay" 
                ErrorMessage="You must enter a number (ex. 5 or 0.50, not 'five')" 
                ValidationExpression="^\d+(\.(\d{2}))?$" 
                ValidationGroup="grpLibraryDetails"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
            Maximum fine to check out:check out:</td>
        <td>$<asp:TextBox ID="txtMaxFinetoCheckOut" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="vldMaxFinesReq" runat="server" 
                ErrorMessage="Maximum fines required" 
                ControlToValidate="txtMaxFinetoCheckOut"></asp:RequiredFieldValidator>&nbsp;<asp:RegularExpressionValidator 
                ID="vldMaxFineToCheckOutFormat" runat="server" 
                ControlToValidate="txtMaxFinetoCheckOut" 
                ErrorMessage="You must enter a number (ex. 5 or 0.50, not 'five')" 
                ValidationExpression="^\d+(\.(\d{2}))?$"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
            Reserve fee:</td>
        <td>$<asp:TextBox ID="txtReserveFee" runat="server"></asp:TextBox><asp:RequiredFieldValidator 
                ID="vldReserveFeeReq" runat="server" 
                ErrorMessage="Reserve fee required" ControlToValidate="txtReserveFee" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>&nbsp;<asp:RegularExpressionValidator 
                ID="vldReserveFeeFormat" runat="server" 
                ControlToValidate="txtReserveFee" 
                ErrorMessage="You must enter a number (ex. 5 or 0.50, not 'five')" 
                ValidationExpression="^\d+(\.(\d{2}))?$" 
                ValidationGroup="grpLibraryDetails"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
            <h4>Checkout information </h4></td>
        <td>
            </td>
            </tr>
    <tr>
        
        <td>Checkout length:</td>
        <td>
            <asp:TextBox ID="txtCheckoutLength" runat="server"></asp:TextBox>
        &nbsp;days
            <asp:RequiredFieldValidator ID="vldCheckoutLenReq" runat="server" 
                ErrorMessage="Checkout length required" 
                ControlToValidate="txtCheckoutLength" ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        &nbsp;<asp:RegularExpressionValidator ID="vldCheckoutLengthFormat" 
                runat="server" ControlToValidate="txtCheckoutLength" 
                ErrorMessage="You must enter a number (ex. 5, not 'five')" 
                ValidationExpression="\d+" ValidationGroup="grpLibraryDetails"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
            Maximum number of times renewable:</td>
        <td>
            <asp:TextBox ID="txtMaxTimesRenewable" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="vldTimesRenewableReq" runat="server" 
                ErrorMessage="Maximum number of times renewable required" 
                ControlToValidate="txtMaxTimesRenewable" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        &nbsp;<asp:RegularExpressionValidator ID="vldMaxTimesRenewableFormat" 
                runat="server" ControlToValidate="txtMaxTimesRenewable" 
                ErrorMessage="You must enter a number (ex. 5, not 'five')" 
                ValidationExpression="\d+" ValidationGroup="grpLibraryDetails"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
            Renewal length:</td>
        <td>
            <asp:TextBox ID="txtRenewLength" runat="server"></asp:TextBox>
        &nbsp;days
            <asp:RequiredFieldValidator ID="vldRenewLengthReq" runat="server" 
                ErrorMessage="Renewal length required" ControlToValidate="txtRenewLength" 
                ValidationGroup="grpLibraryDetails"></asp:RequiredFieldValidator>
        &nbsp;<asp:RegularExpressionValidator ID="vldRenewLengthFormat" runat="server" 
                ControlToValidate="txtRenewLength" 
                ErrorMessage="You must enter a number (ex. 5, not 'five')" 
                ValidationExpression="\d+" ValidationGroup="grpLibraryDetails"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            
            <asp:Button ID="btnSaveDetails" runat="server" Text="Save" 
                onclick="btnSaveDetails_Click" ValidationGroup="grpLibraryDetails" />
            
        </td>
    </tr>
</table>
